package com.songlanyun.modules.comment.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.songlanyun.common.drive.RootEntity;
import com.songlanyun.common.utils.SensiUtil;
import com.songlanyun.modules.rabbitmq.util.SpringContextUtil;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 订单商品评论回复
 * 
 * @author Mark
 * @email sunlightcs@gmail.com
 * @date 2020-11-30 18:09:47
 */
@Data
@TableName("yxt_sale_order_goods_comment_reply")
public class OrderGoodsCommentReply extends RootEntity<Long,OrderGoodsCommentReply> implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	@TableId
	private Long id;
	/**
	 * 回复内容
	 */
	@NotBlank(message = "回复内容不能为空")
	private String content;

	public void setContent(String content) {
		SensiUtil sensiUtil = (SensiUtil) SpringContextUtil.getBean("sensiUtil");
		this.content = sensiUtil.filter(content);

	}

	/**
	 * 评论时间
	 */
	@TableField(fill = FieldFill.INSERT)
	private Date createTime;
	/**
	 * 会员id
	 */
	private Long userId;
	/**
	 * 商家id
	 */
	private Long shopId;
	/**
	 * 评论id
	 */
	@NotNull(message = "评论不能为空")
	private Long commentId;

	@Override
	public Long getIdentity() {
		return id;
	}
}
